<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="s1">
    <font>1</font>
    <span>2</span>
    <div>3</div>
</div>
<script>
    var s1=document.getElementById("s1");
    //parseInt
    var num=0;
    var childrens=s1.children;//children获取所有子元素
    for (var i = 0; i < childrens.length; i++) {
        num+=parseInt(childrens[i].innerHTML);
    }
    alert(num);
</script>
</body>
</html>